package lesson2.com.demo;

import lesson2.com.marvel.KryptoniteException;
import java.io.FileNotFoundException;

public class ExceptionDemo {
    
        // "f" is Larry
    public void f() throws FileNotFoundException {// , KryptoniteException{
        System.out.println("In method f()");
        g(3);  // handle or declare!!
        System.out.println("Out  method f()");
    }
    
        // "g" is  "Moe"
    public void g(int k) throws FileNotFoundException, NullPointerException { //, KryptoniteException{
        System.out.println("In method g("+k+")");
        if(k==3){
            throw new FileNotFoundException("I DON'T LIKE 3");
        }
        System.out.println("Out method  g("+k+")");
    }

}

